﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class admin_AdminMasterPage : System.Web.UI.MasterPage
{
    clsUser clsUser;

    #region EVENT MODULES

    protected void Page_Load(object sender, EventArgs e)
    {
        //### Check if session clsUser exists
        if (Session["clsUser"] == null)
        {
            Response.Redirect("../frmAdminLogin.aspx");
        }

        clsUser = (clsUser)Session["clsUser"];

        if (!IsPostBack)
        {
            //### Set iUserID
            int iUserID = clsUser.iUserID;



            //### Instantiate a new instance of clsUsersRecord
            clsUsersRecord clsUsersRecord = new clsUsersRecord(clsUser, iUserID);

            //### Set todays date
            DateTime dtToday = DateTime.Today;
            string strDateToday = dtToday.ToString("dd MMM yyyy");

            //### Set lbl info to logged in user
            headContent.InnerHtml = "<div id=\"headInfo\"><b>Welcome</b>: " + clsUsersRecord.strFirstName + " " + clsUsersRecord.strSurname + "";
            headContent.InnerHtml += "<br /><b style=\"font-size:10px;\">" + strDateToday + "</b>";
            headContent.InnerHtml += "<br /><b id=\"CMSLabel\">MonstromPets :: CMS</b>";
            headContent.InnerHtml += "</div>";
        }
    }

    #endregion
 
}
